
package org.spring.nacos.domain.user.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Setter
@Getter
@Slf4j
@ToString
@Component
public class UserEntity implements InitializingBean, DisposableBean {
    @Value("${user.name}")
    private String name;
    @Value("${user.age}")
    private int age;

    @Override
    public void afterPropertiesSet() {
        log.info("[init:{}]", this);
    }


    @Override
    public void destroy() {
        log.info("[destroy:{}]", this);
    }
}
